﻿<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>娟姐的在线商城</title>
    <link href="bootstrap-3.3.5-dist/bootstrap-3.3.5-dist/css/bootstrap.min.css" rel="stylesheet" />
    <link href="Content/goodsList.css" rel="stylesheet" />
    <link href="Pager/css/simplePagination.css" rel="stylesheet" />
</head>
<body>
    <nav class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="#">娟姐的在线商城</a>
            </div>
            <div id="navbar" class="navbar-collapse collapse">
                <form class="navbar-form navbar-right">
                    <div class="form-group">
                        <input id="goodContent" type="text" placeholder="商品名称" class="form-control">
                    </div>
                    <button  type="submit" class="btn btn-success" onclick="changePage(1, initPage); return false;">搜索</button>
                </form>
            </div><!--/.navbar-collapse -->
        </div>
    </nav>
    <div class="container">
        <div  class="row">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
               
                <img style="width:80px;height:80px;" class="pull-right" src="sm.png" />
                <h4 class="pull-right">android：</h4>
            </div>
        </div>
        <div id="content" class="row">
        </div>
        <div  class='pagination-holder'><div id='light-pagination'></div></div>
    </div>
    <footer class="footer">
        <div class="container">
            <p class="text-muted">更多精彩关注微信：tuxuepian_0258</p>
        </div>
    </footer>
    <script src="Scripts/jquery.min.js"></script>
    <script src="bootstrap-3.3.5-dist/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
    <script src="Pager/js/jquery.simplePagination.js" charset="gbk"></script>
    <script>
        changePage(1, initPage);
        //初始化分页
        function initPage(count) {
            $("#light-pagination").show();
            var itemsOnPage = 1;
            $("#light-pagination").pagination({
                items: count, // 总页数
                itemsOnPage: itemsOnPage,
                cssStyle: 'light-theme',
                //onInit: changePage,    初始化函数
                onPageClick: changePage   //点击时触发函数
            });
        }

        //页面改变
        function changePage(pageIndex, callback) {
            $.get("/Data/GetAfterTranscodingDataList", { pageIndex: pageIndex, goodContent: $("#goodContent").val() }, function (msg) {
                $("#content div").remove();
                $(msg.data).each(function (index, element) {
                    var temp =
                        '<div class="goods col-xs-6 col-sm-6 col-md-4 col-lg-3">' +
                            element.Content +
                        '</div>';
                    $("#content").append(temp);
                });
                $(".goods").click(function () {
                    window.location.href = $(this).children("a").attr("href");
                });
                if (typeof callback == "function") callback(msg.count);
            });
        }
    </script>
</body>
</html>

